$OpenBSD: patch-imap_src_osdep_unix_env_unix_c,v 1.3 2016/07/10 11:55:21 ajacoutot Exp $
--- imap/src/osdep/unix/env_unix.c.orig	Mon Jan 12 05:12:25 2015
+++ imap/src/osdep/unix/env_unix.c	Sun Jul 10 11:38:07 2016
@@ -644,11 +644,11 @@ long server_input_wait (long seconds)
 static struct passwd *pwuser (unsigned char *user)
 {
   unsigned char *s;
-  struct passwd *pw = getpwnam (user);
+  struct passwd *pw = getpwnam_shadow (user);
   if (!pw) {			/* failed, see if any uppercase characters */
     for (s = user; *s && ((*s < 'A') || (*s > 'Z')); s++);
     if (*s) {			/* yes, try all lowercase form */
-      pw = getpwnam (s = lcase (cpystr (user)));
+      pw = getpwnam_shadow (s = lcase (cpystr (user)));
       fs_give ((void **) &s);
     }
   }
@@ -967,15 +967,12 @@ char *myhomedir ()
 static char *mymailboxdir ()
 {
   char *home = myhomedir ();
-				/* initialize if first time */
-  if (!myMailboxDir && myHomeDir) {
     if (mailsubdir) {
       char tmp[MAILTMPLEN];
       sprintf (tmp,"%s/%s",home,mailsubdir);
       myMailboxDir = cpystr (tmp);/* use pre-defined subdirectory of home */
     }
     else myMailboxDir = cpystr (home);
-  }
   return myMailboxDir ? myMailboxDir : "";
 }
 
